<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 * @author   howe <howe1995@163.com>
 */

namespace HyperfTest\Cases;

use App\Dao\UserDao;
use Hyperf\Context\ApplicationContext;
use HyperfTest\HttpTestCase;

/**
 * @internal
 * @coversNothing
 */
class UserTest extends HttpTestCase
{
    public function testUserDaoFirst()
    {
        // composer test -- --filter=testUserDaoFirst
        $model = ApplicationContext::getContainer()->get(UserDao::class)->first(1);
        var_dump($model);
        $this->assertSame(1, $model->id);
    }

    public function testUserDaoAll()
    {
        // composer test -- --filter=testUserDaoAll
        $models = ApplicationContext::getContainer()->get(UserDao::class)->all(['id']);
        var_dump($models->toArray());
        $this->assertIsArray($models->toArray());
    }
}
